package org.jmap.test;

import org.jmap.core.Extent;
import org.jmap.core.MapPoint;

public class Extents {

	public static void main(String[] args) {
		Extent worldExtent = new Extent(-180, -90, 180, 90);
		Extent northWestExtent = new Extent(-180, 0, 0, 90);
		Extent northEastExtent = new Extent(0, 0, 180, 90);
		MapPoint origin = new MapPoint(-60d, 35d);
		
		System.out.println(pointInExtentTest(origin, northEastExtent, true));
		System.out.println("Point " + origin.toShortString() + " in north west " + pointInExtentTest(origin, northWestExtent, true));
	}
	
	public static boolean pointInExtentTest(MapPoint point, Extent extent, boolean inclusive) {
		return extent.containsPoint(point, inclusive);
	}
}
